home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / Java / Pdapilot / Record.java < prev    next >
Text File  |  1997-08-08  |  1KB  |  43 lines

  1.  
  2. package Pdapilot;
  3.  
  4. import java.io.*;
  5.  
  6. /** A representation of a database record.
  7.  */
  8.  
  9. public class Record extends Block {
  10.         public int index, category;
  11.         public RecordID id;
  12.         public boolean deleted, modified, busy, secret, archived;
  13.         
  14.         public Record() {
  15.             super();
  16.         }
  17.         
  18.         public Record(byte[] contents, RecordID id, int index, int attr, int category) {
  19.             this.id = id;
  20.             this.index = index;
  21.             this.deleted = ((attr & 0x80)!=0) ? true : false;
  22.             this.modified = ((attr & 0x40)!=0) ? true : false;
  23.             this.busy = ((attr & 0x20)!=0) ? true : false;
  24.             this.secret = ((attr & 0x10)!=0) ? true : false;
  25.             this.archived = ((attr & 0x08)!=0) ? true : false;
  26.             this.category = category;
  27.             this.unpack(contents);
  28.         }
  29.         
  30.         public void Fill() {
  31.             this.deleted = false;
  32.             this.modified = false;
  33.             this.busy = false;
  34.             this.secret = false;
  35.             this.archived = false;
  36.         }
  37.         
  38.         public String describe() {
  39.             return " id "+id+", index "+index+", deleted "+deleted+", modified "+modified+
  40.             ", busy "+busy+", secret "+secret+", archived "+archived+", category "+ category;
  41.         }
  42. }
  43.